Wallis filter is a filter used in image processing for improving the local contrast in an image. The Wallis Filter adjusts brightness values in local areas of the image, such that good local contrast is generated throughout the image, while reducing the overall contrast between bright and dark areas. This ensures that the displayed pixels are in the visible range and saturation (if any) is removed from the image.
For each pixel Gin (grey value of the input pixel) in an image, Gout (grey value of the output pixel) is calculated using the following formula:Gout=Mout*Fac+Min*(1−Fac)+(Gin−Min)*Sout/Sin where,Min is mean grey value of the neighborhood (wherein the neighborhood is as defined by window size, W) around the input pixel, Sin is standard deviation of the grey value of the neighborhood (as defined by window size, W) around the input pixel, Mout is desired mean grey value of the output pixel neighborhood, Sout is desired standard deviation grey value of the output pixel neighborhood and Fac is factor for desired mean.
The approximate range of values may be as follows:
Mout=100 on scale of 0 to 255;
Sout=50 on scale of 0 to 255;
Gain Limit (Sout/Sin)=7 (<7);
Fac=1 (0.0−1.0)
W=19 to 99 (ideally, W>49)
For each pixel in the image, the mean of the surrounding Wallis window region (W) with complexity O(W*W) is computed. The standard deviation in the surrounding Wallis window region is further computed with complexity O(W*W). Gout is computed based on Gin, Min and Sin. Time complexity of the above traditional algorithm is O(n*W*W), where n is the number of pixels in the image, W is the Wallis window size. Standard deviation (s) is calculated using the formula given below:
            s      N        =                  √                  1          N                    ⁢                        ∑                      i            =            1                    N                ⁢                                  ⁢                              (                                          x                i                            -                              x                _                                      )                    2                      ,where xi represents the pixel value and x represents the mean.
The above traditional Wallis algorithm is computationally very intensive, as the above mentioned steps have to be repeated for every pixel in the image. Also, the level of computation increases with an increase in W, whereas a high value of W improves the results further. Hence, use of a standard Wallis filter may not be suitable for real time panning (roaming) GIS applications, as applying Wallis filter takes a long time when panning an image, resulting sticky roam behaviour.
Currently, there are solutions which use intensive computing power (such as a specialized graphics card) to enable application of Wallis filters in real time panning GIS applications. However, the equipment costs prove to be very expensive and these solutions do not reduce the computation intensive nature of the Wallis filter.